package com.punai.Incomedata.controller;

import com.punai.Incomedata.service.EndSettlementService;
import com.punai.Incomedata.service.StartBudgetService;
import com.punai.Incomedata.vo.EndSettlementVo;
import com.punai.Incomedata.vo.IProLibIncomeBaseVo;
import com.punai.Incomedata.vo.StartBudgetVo;
import com.punai.common.core.controller.BaseController;
import com.punai.common.core.domain.AjaxResult;
import com.punai.common.core.page.TableDataInfo;
import com.punai.externalccb.constants.CCBConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/incomedata/endsettlement")
public class EndSettlementController extends BaseController {

    @Autowired
    private EndSettlementService endSettlementService;

    @PreAuthorize("@ss.hasPermi('prolib.income.endsettlement.getMainTableData')")
    @GetMapping("/getMainTableData")
    public TableDataInfo list(EndSettlementVo vo) {
        vo.setCcbType(CCBConstants.CCB_TYPE.KGYSSJ.getCode());
        startPage();
        return endSettlementService.selectMainTableDataSize(vo);
    }

    @PreAuthorize("@ss.hasPermi('prolib.income.endsettlement.getCbBidNodeList')")
    @GetMapping("/getCbBidNodeList")
    public AjaxResult cbBidNodeList(EndSettlementVo vo) {
        vo.setCcbType(CCBConstants.CCB_TYPE.JGJSSJ.getCode());
        return AjaxResult.success(endSettlementService.selectCbBidNodeList(vo));
    }

    @PreAuthorize("@ss.hasPermi('prolib.income.endsettlement.getDetailTableDataList')")
    @GetMapping("/getDetailTableDataList")
    public AjaxResult detailTableDataList(EndSettlementVo vo) {
        vo.setCcbType(CCBConstants.CCB_TYPE.JGJSSJ.getCode());
        return AjaxResult.success(endSettlementService.selectDetailTableDataList(vo));
    }
}
